package com.ruoyi.shape.service.impl;

import java.util.List;

import com.ruoyi.common.constant.DicConstants;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.shape.domain.ShapeUser;
import com.ruoyi.shape.mapper.ShapeUserMapper;
import com.ruoyi.shape.service.IShapeUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户选择的手型脸型信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-08
 */
@Service
public class ShapeUserServiceImpl implements IShapeUserService
{
    @Autowired
    private ShapeUserMapper shapeUserMapper;

    /**
     * 查询用户选择的手型脸型信息
     *
     * @param id 用户选择的手型脸型信息主键
     * @return 用户选择的手型脸型信息
     */
    @Override
    public ShapeUser selectShapeUserById(Long id)
    {
        return shapeUserMapper.selectShapeUserById(id);
    }

    @Override
    public ShapeUser selectShapeUserByUserIdHand(Long userId)
    {
        return shapeUserMapper.selectShapeUserByUserIdHand(userId);
    }

    @Override
    public ShapeUser selectShapeUserByUserIdFace(Long userId)
    {
        return shapeUserMapper.selectShapeUserByUserIdFace(userId);
    }

    /**
     * 查询用户选择的手型脸型信息列表
     *
     * @param shapeUser 用户选择的手型脸型信息
     * @return 用户选择的手型脸型信息
     */
    @Override
    public List<ShapeUser> selectShapeUserList(ShapeUser shapeUser)
    {
        return shapeUserMapper.selectShapeUserList(shapeUser);
    }

    /**
     * 新增用户选择的手型脸型信息
     *
     * @param shapeUser 用户选择的手型脸型信息
     * @return 结果
     */
    @Override
    public int insertShapeUser(ShapeUser shapeUser)
    {
//        shapeUser.setCreateBy(SecurityUtils.getUserId());
//        shapeUser.setCreateType(DicConstants.BUSINESS_Manager.getCode());
        shapeUser.setCreateTime(DateUtils.getNowDate());
        return shapeUserMapper.insertShapeUser(shapeUser);
    }

    /**
     * 修改用户选择的手型脸型信息
     *
     * @param shapeUser 用户选择的手型脸型信息
     * @return 结果
     */
    @Override
    public int updateShapeUser(ShapeUser shapeUser)
    {
        shapeUser.setUpdateBy(SecurityUtils.getUserId());
        shapeUser.setUpdateType(DicConstants.BUSINESS_Manager.getCode());
        shapeUser.setUpdateTime(DateUtils.getNowDate());
        return shapeUserMapper.updateShapeUser(shapeUser);
    }

    /**
     * 批量删除用户选择的手型脸型信息
     *
     * @param ids 需要删除的用户选择的手型脸型信息主键
     * @return 结果
     */
    @Override
    public int deleteShapeUserByIds(Long[] ids)
    {
        return shapeUserMapper.deleteShapeUserByIds(ids);
    }


    /**
     * 批量逻辑删除用户选择的手型脸型信息
     *
     * @param ids 需要删除的用户选择的手型脸型信息主键
     * @return 结果
     */
    @Override
    public int logicDeleteShapeUser(Long[] ids,String delType,Long delUser)
    {
        return shapeUserMapper.logicDeleteShapeUser(ids,delType,delUser);
    }

    /**
     * 删除用户选择的手型脸型信息信息
     *
     * @param id 用户选择的手型脸型信息主键
     * @return 结果
     */
    @Override
    public int deleteShapeUserById(Long id)
    {
        return shapeUserMapper.deleteShapeUserById(id);
    }
}
